﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.ComponentModel;

namespace JQuery
{
    public enum Tolerance
    {
        Fit,
        Intersect,
        Pointer,
        Touch
    }

    public class DroppableExtender : JQueryExtender
    {
        [JQueryElement("accept", true)]
        public string AcceptSelector
        {
            get { return GetPropertyValue<string>("AcceptSelector", null); }
            set { SetPropertyValue("AcceptSelector", value); }
        }

        [JQueryElement("accept")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        public string Accept
        {
            get { return GetPropertyValue<string>("Accept", null); }
            set { SetPropertyValue("Accept", value); }
        }

        [JQueryElement("addClasses")]
        public bool? AddClasses
        {
            get { return GetPropertyValue<bool>("AddClasses", (bool?)false); }
            set { SetPropertyValue("AddClasses", value); }
        }

        [JQueryElement("greedy")]
        public bool? Greedy
        {
            get { return GetPropertyValue<bool>("Greedy", null); }
            set { SetPropertyValue("Greedy", value); }
        }

        [JQueryElement("hoverClass", SerializeAs = SerializeAs.String)]
        public string HoverCssClass
        {
            get { return GetPropertyValue<string>("HoverCssClass", null); }
            set { SetPropertyValue("HoverCssClass", value); }
        }

        [JQueryElement("tolerance", SerializeAs = SerializeAs.String)]
        public Tolerance? Tolerance
        {
            get { return GetPropertyValue<Tolerance>("Tolerance", null); }
            set { SetPropertyValue("Tolerance", value); }
        }

        [JQueryEvent("activate")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnActivate
        {
            get { return GetPropertyValue<string>("OnActivate", null); }
            set { SetPropertyValue("OnActivate", value); }
        }

        [JQueryEvent("deactivate")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnDeActivate
        {
            get { return GetPropertyValue<string>("OnDeActivate", null); }
            set { SetPropertyValue("OnDeActivate", value); }
        }

        [JQueryEvent("over")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnOver
        {
            get { return GetPropertyValue<string>("OnOver", null); }
            set { SetPropertyValue("OnOver", value); }
        }

        [JQueryEvent("out")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnOut
        {
            get { return GetPropertyValue<string>("OnOut", null); }
            set { SetPropertyValue("OnOut", value); }
        }

        [JQueryEvent("drop")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnDrop
        {
            get { return GetPropertyValue<string>("OnDrop", null); }
            set { SetPropertyValue("OnDrop", value); }
        }

        protected override string jQueryFunction
        {
            get { return "droppable"; }
        }
    }
}
